#ifndef VARIANTMANAGER_H_
#define VARIANTMANAGER_H_

#include "qtvariantproperty.h"

class ImVariantManager : public QtVariantPropertyManager
{
	Q_OBJECT
public:
	ImVariantManager(QObject *parent = 0);
	~ImVariantManager();

	virtual QVariant value(const QtProperty *property) const;
	virtual int valueType(int propertyType) const;
	virtual bool isPropertyTypeSupported(int propertyType) const;

	QString valueText(const QtProperty *property) const;

	public slots:
		virtual void setValue(QtProperty *property, const QVariant &val);
protected:
	virtual void initializeProperty(QtProperty *property);
	virtual void uninitializeProperty(QtProperty *property);
	private slots:
		void slotValueChanged(QtProperty *property, const QVariant &value);
		void slotPropertyDestroyed(QtProperty *property);
private:
	struct Data {
		QVariant value;
		QtVariantProperty *x;
		QtVariantProperty *y;
	};
	QMap<const QtProperty *, Data> propertyToData;
	QMap<const QtProperty *, QtProperty *> xToProperty;
	QMap<const QtProperty *, QtProperty *> yToProperty;
};

#endif